
cd "/Users/john/Dropbox/PartyDuration/Data"
do setup1.do

***************Figure 1

***Descriptives
keep if auth_sample==1 & no_party~=1
keep if rparty_id~=.
sort cowcode year
collapse rparty_lorg_o rparty_pers_o rparty_nom_o rparty_soc_o rparty_off_o org_index_o predate leader_nominates, by (year)

label variable rparty_off_o "Local Org. Ext."
label variable rparty_lorg_o "Local Org. Activity"
label variable rparty_soc_o "Ties to Social. Orgs"
label variable org_index_o "Mass Org. Index"
label variable rparty_pers_o "Party Personalization"
label variable rparty_nom_o "Collective Nomination"


*Do these four as fourpanel figure
twoway line rparty_lorg_o rparty_off_o rparty_soc_o year if year>1972, yscale(r(2 4)) ylabel(2(.5)4) saving(soc, replace) legend(size(vsmall))  ytitle(" ") scheme(s1mono) lpattern(solid dot dash) lwidth(medium thick medium) 
twoway line rparty_pers_o  year if year>1972, yscale(r(1 4)) ylabel(1(.5)4) saving(pers, replace) legend(on) ytitle(" ") scheme(s1color) lcolor(black)
twoway line rparty_nom_o  year if year>1972, yscale(r(0 2)) ylabel(0(.5)2) saving(nom, replace) legend(on) ytitle(" ") scheme(s1color) lcolor(black)


 

cd "/Users/john/Dropbox/PartyDuration/Data"
do setup1.do



***Descriptives
keep if auth_sample==1 & no_party~=1
sort cowcode year
collapse predate, by (year)
label variable predate "Party Predates Regime"
twoway line  predate year if year>1972, yscale(r(.2 1)) ylabel(.2(.2)1) saving(predate, replace) legend(on) ytitle(" ") scheme(s1color) lcolor(black)


 graph combine soc.gph pers.gph nom.gph predate.gph, saving(fig1.png, replace)
 
 
 
 **Data for Figure 2( Code is in R file)

 
 	
***Correlation plot
keep if auth_sample==1
keep rparty_lorg rparty_off rparty_soc rparty_nom predate rparty_pers cowcode year
order year cowcode rparty_lorg rparty_off rparty_soc rparty_pers rparty_nom predate
saveold corr, version(12) replace
 
 
